import _axios from 'axios';

const axios = _axios.create({
  transformRequest: [function (data) {
    // 将数据转换为表单数据
    let ret = '';
    for (let it in data) {
      if (ret !== '') {
        ret += '&';
      }
      ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it])
    }
    return ret
  }],
  headers: {
    'Content-Type': 'application/x-www-form-urlencoded',
  },
});


